<div id='add_new'>
    <table width='100%' cellpadding='0' cellspacing='2'>
        <tr>
                
<?php 
if (has_access_to('Files::Upload Files')) {
?>    
<td>            
    <b>Upload a file</b><br>
<?php echo form_tag('add',array('multipart'=>true,'validation'=>true))?>
<?php echo hidden_field_tag('files[file_folder_id]',$file_folder_id)?>
<?php echo hidden_field_tag('file_folder_id',$file_folder_id)?>
<?php echo hidden_field_tag('redirect',$redirect)?>
<?php echo hidden_field_tag('action','add_file')?>
<?php echo hidden_field_tag('MAX_FILE_SIZE',MAX_FILE_SIZE)?>
<?php echo file_field_tag('name',array('alt'=>'file|'.get_allowed_types()))?>
<?php echo submit_tag('Upload')?><br>
<span style='font-size:xx-small'>Max file size is <?php echo string_format_file_size(MAX_FILE_SIZE)?></span>
<?php echo end_form_tag()?>
</td>
<?php } ?>
<?php 
if (has_access_to('Files::Create Folders')) {
?>
<td>
<b>Create A Folder</b><br>
<?php echo form_tag('add',array('validation'=>true))?>
<?php echo hidden_field_tag('folders[parent_id]',$file_folder_id)?>
<?php echo hidden_field_tag('file_folder_id',$file_folder_id)?>
<?php echo hidden_field_tag('redirect',$redirect)?>
<?php echo hidden_field_tag('action','add_folder')?>
<?php echo text_field('folders','name',array('alt'=>'alnum|1|a|true|false|_-','emsg'=>'Folder name can not be blank, contain spaces or special characters'))?>
<?php echo submit_tag('Create')?>
<?php echo end_form_tag()?>
</td>
<?php } ?>
</tr></table>
</div>